package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler;

import com.iwhalecloud.bss.kite.cucc.service.attr.handler.MVProvincesAccessModeAttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.annotation.AttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.impl.AbstractAttrLinkageHandler;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import org.springframework.stereotype.Service;

import java.util.Objects;

@Service
@AttrHandler(MVProvincesAccessModeAttrHandler.class)
public class MVProvincesAccessModeAttrLinkHandler extends AbstractAttrLinkageHandler<AttrData> {

    @Override
    public void handle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {
        KiteAttr acceCircuitTypeAttr = kiteInst.getAttr("2_0000053");
        if (Objects.nonNull(acceCircuitTypeAttr)) {
            acceCircuitTypeAttr.setValue(kiteAttr.getValue());
            acceCircuitTypeAttr.setValueDesc(kiteAttr.getValueDesc());
        }
    }

    @Override
    public void handleStyle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {

    }
}
